<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2008 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/conformanceFunction.xsl"?>
<testcase
  xmlns="http://xbrl.org/2008/conformance"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:fcn="http://xbrl.org/2008/function"
  xmlns:cfcn="http://xbrl.org/2008/conformance/function"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xqt-err="http://www.w3.org/2005/xqt-errors"
  xmlns:concept="http://xbrl.org/formula/conformance/example" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xl="http://www.xbrl.org/2003/XLink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  http://xbrl.org/2008/conformance ../schemas/conformance.xsd
  http://xbrl.org/2008/conformance/function ../schemas/conformanceFunction.xsd
  ">
  <owners>
    <reg:owner id="herm">
      <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>
      <reg:email>fischer@markv.com</reg:email>
     <reg:assumedOwnership moment="2008-12-12T00:00:00" />
    </reg:owner>
    
   <reg:owner id="andy">
      <reg:name>Andy Harris</reg:name>
      <reg:affiliation>UBMatrix</reg:affiliation>
      <reg:email>andy.harris@ubmatrix.com</reg:email>
     <reg:assumedOwnership moment="2010-09-12T01:07:00" />
    </reg:owner>
  </owners>

  <number>90507</number>

  <name>Function test for xfi:concept-relationships</name>

  <documentation>
    <xhtml:p>
      Tests of function xfi:concept-relationships($source as xs:QName, $linkrole as xs:string?, $arcrole as xs:string, $axis as xs:string, $generations as xs:integer, $xbrlinstance as element(xbrli:xbrl)) as element(xl:arc)*
    </xhtml:p>
    <xhtml:p>
      Please see the examples and formula-testcase-based variations in the companion file, which is in the formula testcase format, <xhtml:a href="../tests/60000 Extensions/61100 ConceptRelationsFilter-Processing/61100 ConceptRelationsFilter-Processing.xml">61100 ConceptRelationsFilter-Processing.xml</xhtml:a>
    </xhtml:p>
  </documentation>

  <reference xlink:type="simple" xlink:href="http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670666"/>

  <variation id="V-01">
    <name>Presentation descendants, link1, top level, 1 generation</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V01" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V01">
        xfi:concept-relationships(
           QName('http://abc.com/test','A'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'descendant',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 3 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","presentationArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A2") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","A3")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-02">
    <name>Presentation descendants, concept not in network</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V02" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V02">
        xfi:concept-relationships(
           QName('http://abc.com/test','B'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'descendant',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty($result)
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-03">
    <name>Presentation descendants, concept a leaf node</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V03" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V03">
        xfi:concept-relationships(
           QName('http://abc.com/test','A111'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'descendant',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty($result)
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-04">
    <name>Presentation ancestors, 3 generations</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V04" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V04">
        xfi:concept-relationships(
           QName('http://abc.com/test','A111'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'ancestor',
           3)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 3 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","presentationArc")) and
         xfi:relationship-from-concept($result[1]) eq QName("http://abc.com/test","A11") and
         xfi:relationship-from-concept($result[2]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-from-concept($result[3]) eq QName("http://abc.com/test","A")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-05">
    <name>Presentation ancestors, 4 generations</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V05" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V05">
        xfi:concept-relationships(
           QName('http://abc.com/test','A111'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'ancestor',
           4)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 3 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","presentationArc")) and
         xfi:relationship-from-concept($result[1]) eq QName("http://abc.com/test","A11") and
         xfi:relationship-from-concept($result[2]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-from-concept($result[3]) eq QName("http://abc.com/test","A")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-06">
    <name>Presentation siblings</name>
    <documentation>
      <xhtml:p>
        This case has the siblings of non-root concepts (mid-tree).
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V06" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V06">
        xfi:concept-relationships(
           QName('http://abc.com/test','A13'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'sibling',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 2 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","presentationArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A11") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A12")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-06a">
    <name>Presentation siblings (at root) link 1</name>
    <documentation>
      <xhtml:p>
        This case requests the siblings of a root concept, but root concept has no parent relationships and thus
        siblings is always an empty sequence (see the function's description of sibling axis). 
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V06a" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V06a">
        xfi:concept-relationships(
           QName('http://abc.com/test','A'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'sibling',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty($result)
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-06b">
    <name>Presentation siblings for (at root) link 2</name>
    <documentation>
      <xhtml:p>
        Same as V-06a but for link2.  Concept B in link2 has a "companion" root element C, but C
        is not a sibling because B and C don't share a parent, so the list of siblings is empty.
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V06b" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V06b">
        xfi:concept-relationships(
           QName('http://abc.com/test','B'), 
           'http://abc.com/role/link2',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'sibling',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
      	empty($result)
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-06c">
    <name>Presentation siblings (leaf node)</name>
    <documentation>
      <xhtml:p>
        Same as V-06a but for a leaf node (tree-bottom).
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V06c" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V06c">
        xfi:concept-relationships(
           QName('http://abc.com/test','B1'), 
           'http://abc.com/role/link2',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'sibling',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 1 and 
         xfi:relationship-to-concept($result) eq QName("http://abc.com/test","A2")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-07">
    <name>Presentation siblings</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V07" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V07">
        xfi:concept-relationships(
           QName('http://abc.com/test','A12'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'sibling',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 2 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","presentationArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A11") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A13")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-07a">
    <name>Presentation siblings (at root) link1</name>
    <documentation>
      <xhtml:p>
        Same as V-06a but for siblings at root.  As no parent relationships exist there cannot be any sibling result.
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V07a" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V07a">
        xfi:concept-relationships(
           QName('http://abc.com/test','B'), 
           'http://abc.com/role/link2',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'sibling',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         empty($result)
      </cfcn:test>
    </outputs>
  </variation>

<!-- this axis is not in the current definition
  <variation id="V-07c">
    <name>Presentation sibling-or-abstract-descendant axis</name>
    <documentation>
      <xhtml:p>
        Represents us-gaap pattern where contributing items come from descendants
        when the sibling is abstract.  Here A11 is abstract and its children are
        contributors to be included in treewalk, but A12 is not abstract so its
        children are not included.
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V07c" xlink:type="simple" xlink:href="nav-rel-test-with-abstract.xsd"/>
     <cfcn:call file="V07c">
        xfi:concept-relationships(
           QName('http://abc.com/test','A13'), 
           'http://abc.com/role/link1',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'sibling-or-abstract-descendant',
           3)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 5 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","presentationArc") and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A11") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A111") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","A112") and
         xfi:relationship-to-concept($result[4]) eq QName("http://abc.com/test","A113") and
         xfi:relationship-to-concept($result[5]) eq QName("http://abc.com/test","A12"))
      </cfcn:test>
    </outputs>
  </variation>
-->

  <variation id="V-08">
    <name>Presentation full treewalk from root, all generations</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V08" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V08">
        xfi:concept-relationships(
           QName('http://www.xbrl.org/2008/function/instance','root'), 
           'http://abc.com/role/link2',
           'http://www.xbrl.org/2003/arcrole/parent-child',
           'descendant',
           0)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 4 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","presentationArc")) and
         (xfi:relationship-from-concept($result[1]) eq QName("http://abc.com/test","B") and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","B1") and
         xfi:relationship-from-concept($result[2]) eq QName("http://abc.com/test","B") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A2") and
         xfi:relationship-from-concept($result[3]) eq QName("http://abc.com/test","C") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","C1") and
         xfi:relationship-from-concept($result[4]) eq QName("http://abc.com/test","C1") and
         xfi:relationship-to-concept($result[4]) eq QName("http://abc.com/test","A3")) or
         (xfi:relationship-from-concept($result[1]) eq QName("http://abc.com/test","C") and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","C1") and
         xfi:relationship-from-concept($result[2]) eq QName("http://abc.com/test","C1") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A3") and
         xfi:relationship-from-concept($result[3]) eq QName("http://abc.com/test","B") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","B1") and
         xfi:relationship-from-concept($result[4]) eq QName("http://abc.com/test","B") and
         xfi:relationship-to-concept($result[4]) eq QName("http://abc.com/test","A2"))
        </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-09">
    <name>Definition custom arc treewalk with loop, unlimited generations</name>
    <documentation>
      <xhtml:p>
        Demonstrates that when a descendant (or ancestor) concept repeats in the path from the source, it is not navigated further for unlimited generations navigation (generations=0).  Here navigation starts at A1, for descendants for unlimited generations.  In this case A1 is not included first in the output but A1 is a descendant of A13 (A1-&gt;A13-&gt;A1) so the A1 occurence under A13 is included in the output, but no further navigation from the repeat (directed cycle) beneath A1 is navigated.  (For debugging see V-09a to V-09d.)
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V09" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V09">
        xfi:concept-relationships(
           QName('http://abc.com/test','A1'), 
           'http://abc.com/role/link1',
           'http://abc.com/arcrole/def-test',
           'descendant',
           0)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 9 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","definitionArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A11") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A111") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","A112") and
         xfi:relationship-to-concept($result[4]) eq QName("http://abc.com/test","A113") and
         xfi:relationship-to-concept($result[5]) eq QName("http://abc.com/test","A12") and
         xfi:relationship-to-concept($result[6]) eq QName("http://abc.com/test","A121") and
         xfi:relationship-to-concept($result[7]) eq QName("http://abc.com/test","A122") and
         xfi:relationship-to-concept($result[8]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[9]) eq QName("http://abc.com/test","A1")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-09a">
    <name>Definition custom arc treewalk with loop, link2, unlimited generations</name>
    <documentation>
      <xhtml:p>
        Based on V-09 but using link2 (which has no A11 or A12 subtrees, for easier tracing and debugging).
      </xhtml:p>
      <xhtml:p>
        Here for unlimited generations.  Should result in A1-&gt;A13-&gt;A1, but only provide A13 and A1 in output sequence.
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V09a" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V09a">
        xfi:concept-relationships(
           QName('http://abc.com/test','A1'), 
           'http://abc.com/role/link2',
           'http://abc.com/arcrole/def-test',
           'descendant',
           0)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 2 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","definitionArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A1")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-09b">
    <name>Definition custom arc treewalk with loop, link2, unlimited generations</name>
    <documentation>
      <xhtml:p>
        Here for unlimited generations, with '-or-self'.  Should result in A1-&gt;A13-&gt;A1, and include A1, A13 and A1 in output sequence (representing order of tree walking including self, the first A1).
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V09b" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V09b">
        xfi:concept-relationships(
           QName('http://abc.com/test','A1'), 
           'http://abc.com/role/link2',
           'http://abc.com/arcrole/def-test',
           'descendant',
           0)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 2 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","definitionArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A1")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-09c">
    <name>Definition custom arc treewalk with loop, link2, 7 generations</name>
    <documentation>
      <xhtml:p>
        Specified depth of tree walk generations, including recursion.
        Demonstrates that when a descendant (or ancestor) concept repeats in the path from the source, for a specified generation count the directed cycle continues to be navigated.  Here navigation starts at A1, for descendants (not self) for 7 generations.  In this case A1 is not included first in the output but A1 is a descendant of A13 (A1-&gt;A13-&gt;A1), so the actual result shows A13-&gt;A1-&gt;A13-&gt;A1-&gt;A13-&gt;A1-&gt;A13.
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V09c" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V09c">
        xfi:concept-relationships(
           QName('http://abc.com/test','A1'), 
           'http://abc.com/role/link2',
           'http://abc.com/arcrole/def-test',
           'descendant',
           7)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 7 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","definitionArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[4]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-to-concept($result[5]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[6]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-to-concept($result[7]) eq QName("http://abc.com/test","A13")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-09d">
    <name>Definition custom arc treewalk with loop, link2, 7 generations</name>
    <documentation>
      <xhtml:p>
        Specified depth of tree walk generations, including recursion.
      </xhtml:p>
     </documentation>
    <inputs>
     <schema readMeFirst="true" id="V09d" xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <cfcn:call file="V09d">
        xfi:concept-relationships(
           QName('http://abc.com/test','A1'), 
           'http://abc.com/role/link2',
           'http://abc.com/arcrole/def-test',
           'descendant',
           7)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 7 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","definitionArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[4]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-to-concept($result[5]) eq QName("http://abc.com/test","A13") and
         xfi:relationship-to-concept($result[6]) eq QName("http://abc.com/test","A1") and
         xfi:relationship-to-concept($result[7]) eq QName("http://abc.com/test","A13")
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-10">
    <name>Calculation relations with weights, default link</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
     </documentation>
    <inputs>
     <schema xlink:type="simple" xlink:href="nav-rel-test1.xsd"/>
     <linkbase readMeFirst="true" id="V10" xlink:type="simple" xlink:href="nav-rel-test1-detached-calculation.xml"/>
     <cfcn:call file="V10">
        xfi:concept-relationships(
           QName('http://abc.com/test','A11'), 
           '',
           'http://www.xbrl.org/2003/arcrole/summation-item',
           'descendant',
           1)
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count($result) eq 3 and 
         (every $r in $result satisfies 
            xfi:relationship-name($r) eq QName("http://www.xbrl.org/2003/linkbase","calculationArc")) and
         xfi:relationship-to-concept($result[1]) eq QName("http://abc.com/test","A111") and
         xfi:relationship-to-concept($result[2]) eq QName("http://abc.com/test","A112") and
         xfi:relationship-to-concept($result[3]) eq QName("http://abc.com/test","A113") 
      </cfcn:test>
    </outputs>
  </variation>


  <revisions>
    <reg:revision on="2008-12-12T00:00:00" by="herm">
      <xhtml:p>
        Created the test case in original form for navigate-relationships.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2009-10-28T20:00:00" by="herm">
      <xhtml:p>
        Adapted this test from original navigate-relationships test.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2009-11-02T12:00:00" by="herm">
      <xhtml:p>
        Fixed typos.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2010-03-08T12:00:00" by="herm">
      <xhtml:p>
        Adapted syntax for opaque relationship object and functions to access relationship results.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2010-09-09T00:00:00" by="herm">
      <xhtml:p>
        Changed role URIs to strings for cast-less coding and to be similar to fn:QName's $paramURI, an xs:string.
      </xhtml:p>
    </reg:revision>
  
  <reg:revision on="2010-09-11T12:00:00" by="andy">
      <xhtml:p>
        Fixed typos.
      </xhtml:p>
    </reg:revision>
  
  <reg:revision on="2010-09-14T12:00:00" by="andy">
      <xhtml:p>
        Fixed issues raised by Okumura-san.
      </xhtml:p>
    </reg:revision>

  </revisions>

</testcase>





